import Vue from 'vue'
import Router from 'vue-router'      //路由模块
import Home from './views/Home.vue'   //主页组件
//import Mine from './views/Mine.vue'
Vue.use(Router)   //vue.use()  添加路由模块 ，增加功能
import Playing from './views/Playing'
import Comming from './views/Comming'

//单页应用      single  page  app      没有页面跳转只是在一个页面显示，
export default new Router({
//mode: 'history',
//base: process.env.BASE_URL,
  routes: [ //路由配置（以往的页面
      {
      	path:'/',redirect:'/home'    //重定向，将路由的默认打开，改向/home页面
      },
     
    {
      path: '/home',          //   / 默认路径  
      name: 'home',       // 命名路由
      component: Home,     // 访问到路由时，渲染的组件（页面
      //配置子路由
      children:[         
           {path:"playing",component:Playing},
           {path:"comming",component:Comming},
           {path:'',redirect:'playing'}
      ]
      
    },
   {
   	path:'/movie:movieId',
    	name:'movie',
//  	component:Mine,
    	component: ()=>import('./views/Movie.vue')
   },
   {
   	path:'/show&:movieId&:day&:cinemasId',
   	name:'show',
   	component: ()=>import('./views/Show.vue')
   }
    
  ]
})
